<?php


if(!defined('IN_DISCUZ')) {
	exit('Access Denied');
}

class plugin_yzs1013_pldr {
	var $conf = array();
	var $isopen = FALSE;

	function plugin_yzs1013_pldr() {
		global $_G;		
		if(!isset($_G['cache']['plugin'])){
			loadcache('plugin');
		}
		$this->isopen = $_G['cache']['plugin']['yzs1013_pldr']['isopen'] ? TRUE : FALSE;
		if($this->isopen) {
			$this->conf = $_G['cache']['plugin']['yzs1013_pldr'];		
			$this->conf['usefids'] = (array)unserialize($this->conf['usefids']);
			$this->conf['usergroups'] = (array)unserialize($this->conf['usergroups']);
			loadcache('yzs1013_pldr');
			$this->conf = array_merge($this->conf, (array)unserialize(stripslashes($_G['cache']['yzs1013_pldr'])));
				
			if(empty($this->conf['usergroups'][0]) || in_array($_G['groupid'], $this->conf['usergroups'])){
				$this->conf['isgroupid'] = TRUE;
			}
			if(empty($this->conf['usefids'][0]) || in_array($_GET['fid'], $this->conf['usefids'])){
				$this->conf['isfid'] = TRUE;
			}
			if(empty($this->conf['usecatids'][0]) || in_array($_GET['catid'], $this->conf['usecatids'])){
				$this->conf['iscatid'] = TRUE;
			}
		}
	}
}

// forum
class plugin_yzs1013_pldr_forum extends plugin_yzs1013_pldr {

	function forumdisplay_pldr_output() {
		global $_G;
		
		if(!$this->isopen) return '';
		
		@extract($this->conf);
		if($isfid && $isgroupid && $isopen) {
			include template('yzs1013_pldr:gather_post');
		}
		
		return $return;
	}
	
	
}
?>